/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                  *
 *        *************************************************         *
 *        *©2021-2027 HT Corporation All rights reserved *          *
 *        *************************************************         *
 *                                                                  *
 * FileName    : h_vpss.h                                           *
 *                                                                  *
 * Author      : linus                                              *
 *                                                                  *
 * Email       : luoyaojun@haitutech.com                            *
 *                                                                  *
 * Date        : 2022-8-24                                          *
 *                                                                  *
 * Description :                                                    *
 *                                                                  *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H_VPSS_H
#define __H_VPSS_H

#include "h_register.h"
#include "ht_vpss.h"

#define HT_MPP_HANDLE_VPSS (struct ht_vpss *)HT_MPP_HANDLE(HT_ID_VPSS)

struct ht_vpss 
{
	HT_MOD_ID m_id;
	
    struct ht_vpss_ops *ops;

	struct ht_vpss_rtconfig *rt_config;
};

struct ht_vpss_rtconfig
{

	HT_S32 (*vpss_grp_rt_set_abs_crop)(struct ht_vpss *pvpss, HT_S32 vpss_grp, HT_U32 enable, struct rect *prect);
};

struct ht_vpss_ops
{
    HT_S32 (*vpss_grp_init)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_PIXEL_FORMAT fmt);
	HT_S32 (*vpss_grp_exit)(struct ht_vpss *, HT_U32 vpss_chn);
	HT_S32 (*vpss_grp_start_get_frame)(struct ht_vpss *pvpss, HT_U32 vpss_grp);

	HT_S32 (*vpss_chn_get_frame)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_chn, ht_vpss_chn_get_frame_cb cb, void *user);
	// vpss grp send frame

	// vpss grp get frame

	// vpss grp set rotation
	
    HT_S32(*vpss_chn_init)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_chn, 
					struct resolution *res, HT_PIXEL_FORMAT fmt, HT_U32 u32Depth);
	
	HT_S32 (*vpss_chn_exit)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_ch);
    //	HT_S32 (*vpss_suspend_chn)(struct ht_vpss *pvpss);
    //	HT_S32 (*vpss_resume_chn)(struct ht_vpss *pvpss);

    HT_S32 (*vpss_chn_start_get_frame)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_chn);
    HT_S32 (*vpss_chn_stop_get_frame)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_chn);

	HT_S32 (*vpss_chn_get_info)(struct ht_vpss *pvpss, HT_U32 vpss_grp, HT_U32 vpss_chn, HT_S32 *fd, HT_S32 *width, HT_S32 *height);
	
};

HT_S32 ht_vpss_module_register(struct ht_vpss *pvpss);
#endif
